<?php

namespace App\Home\Models;

use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Str;

class Demo extends Model
{
    use SoftDeletes;

    protected $guarded = []; 

public $fieldTypes = <<< EOF
{
    "id": "string",
    "input": "string",
    "dynamic_input": "string",
    "textarea": "string",
    "dynamic_textarea": "string",
    "single_file": "App\\\\Admin\\\\Casts\\\\Json",
    "multiple_file": "App\\\\Admin\\\\Casts\\\\Json",
    "single_box": "string",
    "multiple_box": "App\\\\Admin\\\\Casts\\\\Json",
    "single_select": "string",
    "multiple_select": "App\\\\Admin\\\\Casts\\\\Json",
    "transfer": "App\\\\Admin\\\\Casts\\\\Json",
    "select_tree": "string",
    "cascader": "App\\\\Admin\\\\Casts\\\\Comma",
    "editor": "string",
    "date": "datetime:Y-m-d",
    "time": "datetime:Y-m-d H:i:s",
    "datetime": "string",
    "password": "App\\\\Admin\\\\Casts\\\\Password",
    "other": "string",
    "created_at": "datetime:Y-m-d H:i:s",
    "updated_at": "datetime:Y-m-d H:i:s",
    "deleted_at": "datetime:Y-m-d H:i:s"
}
EOF;   

    public function __construct(){
        parent::__construct();
        $this->mergeCasts(json_decode($this->fieldTypes, true));
    }
}
